var test = [];

console.log(test.indexOf('a'));

test.push('a');
console.log(test.indexOf('a'));